var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(t, e) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(t, e) {
        t.__proto__ = e;
    } || function(t, e) {
        for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]);
    })(t, e);
}, function(t, e) {
    function n() {
        this.constructor = t;
    }
    o(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, 
    new n());
}), a = this && this.__decorate || function(t, e, o, n) {
    var i, r = arguments.length, c = r < 3 ? e : null === n ? n = Object.getOwnPropertyDescriptor(e, o) : n;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) c = Reflect.decorate(t, e, o, n); else for (var p = t.length - 1; 0 <= p; p--) (i = t[p]) && (c = (r < 3 ? i(c) : 3 < r ? i(e, o, c) : i(e, o)) || c);
    return 3 < r && c && Object.defineProperty(e, o, c), c;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = cc._decorator, s = r.ccclass, c = r.property, l = function(e) {
    function t() {
        var t = null !== e && e.apply(this, arguments) || this;
        return t.auto = !0, t.repeat = 0, t.delayTime = 0, t.tween = null, t;
    }
    return i(t, e), t.prototype.onLoad = function() {
        this.getTween();
    }, t.prototype.onEnable = function() {
        this.auto && (this.doInit(), this.doActionStart());
    }, t.prototype.onDisable = function() {
        this.doActionStop();
    }, t.prototype.doInit = function() {}, t.prototype.doActionStart = function() {
        var t = this;
        this.tween && this.tween.call(function() {
            t.node.emit("action_finished");
        }).start();
    }, t.prototype.doActionStop = function() {
        cc.Tween.stopAllByTarget(this.node);
    }, t.prototype.doActionEnd = function() {}, t.prototype.getTween = function() {
        this.tween || (this.tween = cc.tween(this.node)), this.delayTime && this.tween.delay(this.delayTime), 
        0 < this.repeat ? this.tween.repeat(this.repeat, this.getAction()) : this.repeat < 0 ? this.tween.repeatForever(this.getAction()) : this.tween.then(this.getAction());
    }, t.prototype.getAction = function() {
        return cc.tween();
    }, a([ c ], t.prototype, "auto", void 0), a([ c(cc.Integer) ], t.prototype, "repeat", void 0), 
    a([ c ], t.prototype, "delayTime", void 0), a([ s ], t);
}(cc.Component);

n.default = l;